import { defineStore } from "pinia"

export const useRouteStore = defineStore("route", {
  state: () => ({
    routeList: sessionStorage.getItem("routeList")
      ? JSON.parse(sessionStorage.getItem("routeList"))
      : [],
    isUpdate: false,
  }),
  actions: {
    updateRouteList(routeList) {
      this.routeList = routeList
      sessionStorage.setItem("routeList", JSON.stringify(routeList))
      this.isUpdate = true
    },
  },
  getters: {},
})
